<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>速报视图</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,target-densitydpi=device-dpi">
	<link rel="stylesheet" type="text/css" href="JS/bootstrap/bootstrap/dist/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="SWIPER/Swiper/dist/css/swiper.min.css">
	<link rel="stylesheet" type="text/css" href="CSS/home.css">
	<link rel="stylesheet" type="text/css" href="CSS/fixed.css">
	<link rel="stylesheet" type="text/css" href="FONT/style.css">
	<script type="text/javascript" src="JQUERY/bower/jquery/dist/jquery.min.js"></script>
	<script type="text/javascript" src="JS/echart/echarts.min.js"></script>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=k4bHi674VcojGNYv3bwkGtP7XuxMMkPt"></script>
</head>
<body>
	<div class="swiper-container">
		<div class="swiper-header">
			<div class="header-logo">
				<img src="IMAGES/logo/studiesViewlogo.png" />
			</div>
			<div class="header-title">
				<h1>烈度信息</h1>
				<span class="meta-date">2017-07-21</span>
			</div>
			<input type="hidden" id="lat" value="{$data['eqlat']}">
			<input type="hidden" id="lon" value="{$data['eqlon']}">
			<input type="hidden" id="name" value="{$data['eqname']}">
			<input type="hidden" id="province" value="{$data['eqprovince']}">
			<input type="hidden" id="city" value="{$data['eqcity']}">
			<input type="hidden" id="magn" value="{$data['eqmagn']}">
			<input type="hidden" id="int" value="{$data['eqint']}">
			<input type="hidden" id="depth" value="{$data['eqdepth']}">
			<input type="hidden" id="time" value="{$data['eqtime']}">
		</div>
	    <div class="swiper-wrapper">
	    	<!-- <div class="swiper-slide">
	        	{include file="../application/index/view/home/eqmessagel.html" /}
	        </div>
	        <div class="swiper-slide">
	        	{include file="../application/index/view/home/eqmessage.html" /}
	        </div> -->
	        <div class="swiper-slide">
	        	{include file="../application/index/view/home/eqtomap.html" /}
	        </div>
	        <div class="swiper-slide">
	        	{include file="../application/index/view/home/cliConditions.html" /}
	        </div>
	        <div class="swiper-slide">
	        	{include file="../application/index/view/home/peoMessage.html" /}
	        </div>
	        <div class="swiper-slide">
	        	{include file="../application/index/view/home/econConditions.html" /}
	        </div>
	        <div class="swiper-slide">
	        	{include file="../application/index/view/home/enviMessage.html" /}
	        </div>
	        <!-- <div class="swiper-slide">
	        	{include file="../application/index/view/home/topography.html" /}
	        </div> -->
	        <div class="swiper-slide">
	        	{include file="../application/index/view/home/tdMaps.html" /}
	        </div>
	        <!-- <div class="swiper-slide">
	        	{include file="../application/index/view/home/asMessage.html" /}
	        </div>
	        <div class="swiper-slide">
	        	{include file="../application/index/view/home/asMessagePie.html" /}
	        </div>
	        <div class="swiper-slide">
	        	{include file="../application/index/view/home/goverAction.html" /}
	        </div> -->
	    </div>
	</div>

<script type="text/javascript" src="SWIPER/Swiper/dist/js/swiper.jquery.min.js"></script>
<script type="text/javascript" src="JS/getData.js"></script>
<script type="text/javascript" src="JS/chart.js"></script>
<script type="text/javascript">
// 速报试图
// 作者：赵华
// 时间：2017/8/14
	$(document).ready(function(){
		var SuBao = {};
		SuBao.marker = [];
		SuBao.init = function(){
			//时间
			var d = new Date();
			var year = d.getFullYear();
			var month = d.getMonth() + 1;
			var day = d.getDate();
			$('.swiper-container .swiper-header .meta-date').text(year + '-' + month + '-' + day);
			if(typeof pageTitle === 'undefined') {
				var pageTitle = {
					eqmessagel : '地震信息',
					eqmessage : '地震信息',
					asMessage : '余震信息',
					asMessagePie : '余震信息',
					cliConditions : '气候条件',
					econConditions : '经济情况',
					enviMessage : '环境信息',
					goverAction : '政府行动',
					peoMessage : '人口信息',
					tdMaps : '三维地形图',
					topography : '地形地貌',
					eqtomap: '烈度信息'
				}
			}

			var swiperOption = {
				onTransitionEnd: function(swiper) {
					var _this = swiper;
					var _wiper = $(_this.$.find('.swiper-slide-active'));
					var name = _wiper.find('.page-wiper')[0].classList[1];
					var title = pageTitle[name];
					$('.header-title h1').text(title);
				}
			};

			var mySwiper = new Swiper('.swiper-container',swiperOption);
		};

		(function(){
			//分辨率适应
			var pageWidth = document.documentElement.clientWidth || document.body.clientWidth;
			var pageHeight = document.documentElement.clientHeight || document.body.clientHeight;
			$('.swiper-container').css({
				'width': pageWidth + 'px',
				'height': pageHeight + 'px'
			});
		})();
		//获取所有数据
		SuBao.getData = function(){
			var city = $('#name').val();
			var data = {
				city : city
			};
			var p =GetData(data);
			//渲染页面
			//地图实例
			var HIS_EU = {
				Area: '面积',
				CrackDegree: '预估烈度',
				Death: '死亡人数',
				DirectEconomicLoss: '直接经济损失',
				EarthquakeDate: '时间',
				Latitude: '纬度',
				Longitude: '经度',
				Macro_epicenter: '地点',
				Magnitude: '震级'
			};
			var NEAR_EU = {
				name: '城镇',
				GDP: '生产总值',
				POP_ALL: '总人口',
				area: '面积',
				distence: '距震中距离',
				latitude: '纬度',
				longitude: '经度'
			};
			var EQ_CENTER_EU = {
				province: '所属省',
				city: '所属市',
				name: '震中',
				time: '时间',
				lat: '纬度',
				lon: '经度',
				magn: '震级',
				int: '预估烈度',
				depth: '深度'
			};
			var MAP_ICON_SIZE = 20;
			var CHECKED_IMG = 'IMAGES/mapimg/checked.png';
			var NOCHECKED_IMG = 'IMAGES/mapimg/nochecked.png';
			var NO_ROAD_MES =[
                         {
                                   "featureType": "road",
                                   "elementType": "all",
                                   "stylers": {
                                             "visibility": "off"
                                   }
                         }
                    ];
            var ROAD_MES = [
                         {
                                   "featureType": "road",
                                   "elementType": "all",
                                   "stylers": {
                                             "visibility": "on"
                                   }
                         }
                    ];
			var center = {lon:parseFloat($('#lon').val()), lat:parseFloat($('#lat').val())};
			var CENTER_MARKER = 'IMAGES/mapimg/centerstar.png';
			var NEAR_CITY_MARKER = 'IMAGES/mapimg/nearCity.png';
			var HIS_EQ_MARKER_1 = 'IMAGES/icon/tdhis1.png';
			var HIS_EQ_MARKER_2 = 'IMAGES/icon/tdhis2.png';
			var HIS_EQ_MARKER_3 = 'IMAGES/icon/tdhis3.png';
			var HIS_EQ_MARKER = [HIS_EQ_MARKER_1, HIS_EQ_MARKER_2, HIS_EQ_MARKER_3];
			var CURRENT_CITY = $('#name').val();
			p.exportDataTd(function (data) {
				var _data = data.data;
				if(_data) {
					var map = BMinit('BMap', center, _data);
				}
			})
			//天气信息
			p.exportDataCli(function(data) {
				var _data = data.clidata.data;
				var _datadescription = data.clidescription.climate;
				var d = new Date();
				var year = d.getFullYear();
				var month = d.getMonth() + 1;
				console.log(_data);
					var regstr = /[^0-9]/ig;
					var trange = _data.forecast[0].low.replace(regstr,'') + '~' + _data.forecast[0].high.replace(regstr,'') + '℃' ;
					var twind = _data.forecast[0].fengli + ' ' + _data.forecast[0].fengxiang;
					var day = _data.forecast[0].date.replace(regstr,'');
					$('.cliConditions .cli-header .te-range span').text(trange);
					$('.cliConditions .cli-header .te-description .te-wind span').text(twind);
					$('.cliConditions .cli-meta').text(year + '-' + month + '-' + day);
							//渲染列表
					$('.cliConditions .cli-list-container .cli-ul .cli-ul-row').each(function (i,ev) {
								var time = _data.forecast[i + 1].date;
								var wet = _data.forecast[i + 1].type;
								var temp = _data.forecast[i + 1].low.replace(/[^0-9]/ig,'') + '~' + _data.forecast[i + 1].high.replace(/[^0-9]/ig,'') + '℃' ;
								$(ev).find('.cli-ul-row-left .meta-time').text(time);
								$(ev).find('.cli-ul-row-left .meta-wet').text(wet);
								$(ev).find('.cli-ul-row-right .meta-temp').text(temp);
							});
					$('.cliConditions .cli-describe .text-container p').text(_datadescription);
			});
			//人口信息
			p.exportDataPeo(function(data) {
				var _data = data.data[0];
				$('.peoMessage .peo-header .peo-num').text(_data.POP_ALL/10000 || '无数据');
				$('.peoMessage .peo-description .text-container p').text(_data.Population || '无数据');
				var townData = _data.POP_TOWN/10000 || 0;//农村人口
				var countryData =  _data.POP_COUNTRYSIDE/10000 || 0;//城市人口
				var chartData = [townData, countryData];
				var chartType = 'Pie';
				var chartId = 'peoChart';
				Chart(chartType, chartData, chartId);
			})
			//经济信息
			p.exportDataEcon(function(data) {
				var _data = data.data[0];
				$('.econConditions .econ-num').text(parseFloat(_data.GDP/10000).toFixed(2) || '无数据');
				$('.econConditions .econ-description .text-container p').text(_data.Economics || '无数据');
				var firData = _data.FST_INDUSTRY/10000 || 0;
				var secData = _data.SND_INDUSTRY/10000 || 0;
				var thrData = _data.TRD_INDUSTRY/10000 || 0;
				var chartData = [firData, secData, thrData];
				var chartType = 'PencilBar';
				var chartId = 'econChart';
				Chart(chartType, chartData, chartId);
			});
			//环境信息
			p.exportDataEnvir(function(data) {
				var _data = data.data[0];
				$('.enviMessage .envi-num').text(_data.altitudeCenter || '无数据');
				$('.enviMessage .envi-description .text-container p').text(_data.topographic || '无数据');
				$('.topography .topo-container .topo-header span').text(_data.eqtname + '地区地形地貌图' || '无数据');
				$('.topography .topo-description .text-container p').text(_data.topographic || '无数据');
				var firData = parseFloat(_data.altitudeL);
				var secData = parseFloat(_data.altitudeAverage);
				var thrData = parseFloat(_data.altitudeH);
				var chartData = [firData, secData, thrData];
				var chartType1 = 'ShadowBar';
				var chartId1= 'enviChart';
				var chartType2 = 'Line';
				var chartId2 = 'topoChart';
				Chart(chartType1, chartData, chartId1);
				Chart(chartType2, chartData, chartId2)
			});
			//三维地图
			p.exportDataTd(function(data) {
				var _data = data.data;
				if(_data) {
					TDinit('googleMap', center, _data);
					setTdTemplate(_data);
				}
				var h = $('.tdMaps');
			});
			function TDinit(id, center, eqData){
				var map = new BMap.Map(id, {mapType: BMAP_HYBRID_MAP});           // 创建Map实例
				//var map = new BMap.Map(id, {mapType: BMAP_SATELLITE_MAP }); 
				var point = new BMap.Point(center.lon, center.lat); // 创建点坐标
				var centerIcon = new BMap.Icon(CENTER_MARKER, new BMap.Size(MAP_ICON_SIZE, MAP_ICON_SIZE));
				var centerMarker = new BMap.Marker(point, {icon: centerIcon});
				var content = setEqCenterContent('震中信息', getEqCenterMes());
				centerMarker.addEventListener('click', function() {
						setInfoWindow(map, content, point);
					})
				map.addOverlay(centerMarker);
				var nearPointsList = setNearCity(map, eqData.nearCityData);
				var hisPointsList = setHisEq(map, eqData.hisEqData);
				var pointList = nearPointsList.concat(hisPointsList);
				pointList.push(point);
				var view = map.getViewport(eval(pointList));  
				var mapZoom = view.zoom;
				/*map.setCurrentCity(CURRENT_CITY);*/
				centerAndZoom(map, point, mapZoom);
			}
			//百度地图API
			function BMinit(id, center, eqData) {
				var map = new BMap.Map(id);           // 创建Map实例
				var point = new BMap.Point(center.lon, center.lat); // 创建点坐标
				var centerIcon = new BMap.Icon(CENTER_MARKER, new BMap.Size(MAP_ICON_SIZE, MAP_ICON_SIZE));
				var centerMarker = new BMap.Marker(point, {icon: centerIcon});
				var eqmes = getEqCenterMes();
				var content = setEqCenterContent('震中信息', eqmes);
				setInfoWindow(map, content, point);
				centerMarker.addEventListener('click', function() {
						setInfoWindow(map, content, point);
					})
				map.addOverlay(centerMarker);
				setIntensityCricle(map, point, eqmes.magn);
				var nearPointsList = setNearCity(map, eqData.nearCityData);
				var hisPointsList = setHisEq(map, eqData.hisEqData);
				var pointList = nearPointsList.concat(hisPointsList);
				pointList.push(point);
				var view = map.getViewport(eval(pointList));  
				var mapZoom = view.zoom;
				/*map.setCurrentCity(CURRENT_CITY);*/
				centerAndZoom(map, point, mapZoom);
				// 通过JavaScript的prototype属性继承于BMap.Control
				LegnedControl.prototype = new BMap.Control();
				ToEqCenter.prototype = new BMap.Control();
				TrafficLayerControl.prototype = new BMap.Control();
				// 自定义控件必须实现自己的initialize方法,并且将控件的DOM元素返回
				// 在本方法中创建个div元素作为控件的容器,并将其添加到地图容器中
				LegnedControl.prototype.initialize = function(map){
				  // 创建一个DOM元素
				  var div = document.createElement("div");
				  div.className = 'legend';
				  div.setAttribute('ref', 'tuli');
				  div.innerHTML = "<h4 class='ltitle'>图例</h4><label>震中:<span class='item'><img src='IMAGES/mapimg/centerstar.png' /></span></label><label>附近城镇:<span class='item'><img src='IMAGES/mapimg/nearCity.png' /></span></label><label>历史地震:<span class='item'><img src='IMAGES/icon/tdhis1.png' /></span></label>";
				  // 添加DOM元素到地图中
				  map.getContainer().appendChild(div);
				  console.log(div);
				  // 将DOM元素返回
				  return div;
				}
				ToEqCenter.prototype.initialize = function(map){
				  // 创建一个DOM元素
				  var div = document.createElement("div");
				  div.className = 'eqCenter';
				  div.innerHTML = '<button class="eq-center"></button>';
				  div.onclick = function(e) {
				  	centerAndZoom(map, point, mapZoom);
				  }
				  // 添加DOM元素到地图中
				  map.getContainer().appendChild(div);
				  // 将DOM元素返回
				  return div;
				}
				TrafficLayerControl.prototype.initialize = function(map){
				  // 创建一个DOM元素
				  var div = document.createElement("div");
				  div.className = 'track';
				  div.innerHTML = '<span class="track-icon" data="checked"><img src="IMAGES/mapimg/checked.png"></span><span class="track-title">路网</span>';
				  div.onclick = function() {
				  	var _this = this;
				  	var parentNode = _this.childNodes[0];
				  	var node = parentNode.childNodes[0];
				  	var currentData = _this.childNodes[0].attributes[1].nodeValue;
				  	if(currentData === 'nochecked') {
				  		node.setAttribute('src', CHECKED_IMG);
				  		parentNode.setAttribute('data', 'checked');
				  		map.setMapStyle({styleJson: ROAD_MES});
				  	}else{
				  		node.setAttribute('src', NOCHECKED_IMG);
				  		parentNode.setAttribute('data', 'nochecked');
				  		map.setMapStyle({styleJson: NO_ROAD_MES});
				  	}
				  }
				  // 添加DOM元素到地图中
				  map.getContainer().appendChild(div);
				  // 将DOM元素返回
				  return div;
				}
				// 创建控件
				var myLegnedControl = new LegnedControl();
				var myToEqCenter = new ToEqCenter();
				var myTrafficLayerControl = new TrafficLayerControl();
				// 添加到地图当中
				map.addControl(myLegnedControl);
				map.addControl(myToEqCenter);
				map.addControl(myTrafficLayerControl);
				var navOpt = {type: BMAP_NAVIGATION_CONTROL_ZOOM};           
				map.addControl(new BMap.NavigationControl(navOpt)); 
				map.addControl(new BMap.OverviewMapControl());    
				map.addControl(new BMap.MapTypeControl());
				return map;
			}
			function setNearCity(map, nearCity) {
				var points = [];
				nearCity.forEach(function(item, index) {
					var point = new BMap.Point(item.longitude, item.latitude);
					var icon = new BMap.Icon(NEAR_CITY_MARKER, new BMap.Size(MAP_ICON_SIZE, MAP_ICON_SIZE));
					var marker = new BMap.Marker(point, {icon: icon});
					/*var _markerMK = {
						id: 'near' + index,
						marker: marker
					};
					this.marker.push(_markerMK);*/
					var content = setNearContent('附近城镇信息', item);
					marker.addEventListener('click', function() {
						setInfoWindow(map, content, point);
					})
					map.addOverlay(marker);
					points.push(point);
					index++;
				})
				return points;
			}
			function setHisEq(map, hisEq) {
				var points = [];
				var index = 0;
				for(var key in hisEq) {
					if(hisEq.hasOwnProperty(key)) {
						var val = hisEq[key];
						var point = new BMap.Point(val.Longitude, val.Latitude);
						var icon = new BMap.Icon(HIS_EQ_MARKER[index], new BMap.Size(MAP_ICON_SIZE, MAP_ICON_SIZE));
						var marker = new BMap.Marker(point, {icon: icon});
						/*var _markerMK = {
							id: 'his' + key,
							marker: marker
						};
					this.marker.push(_markerMK);*/
						(function(item, poi){
							var content = setHisContent('历史地震信息', item);
							marker.addEventListener('click', function() {
								setInfoWindow(map, content, poi);
							});
						})(val, point)
						map.addOverlay(marker);
						points.push(point);
						index++;
					}
				}
				return points;
			}
			function setInfoWindow(map, content, point) {
				var infoWindow = new BMap.InfoWindow(content);  // 创建信息窗口对象 
				map.openInfoWindow(infoWindow,point); //开启信息窗口
			}
			// 定义一个控件类,即function
			function LegnedControl(){
			  // 默认停靠位置和偏移量
			  this.defaultAnchor = BMAP_ANCHOR_BOTTOM_RIGHT;
			  this.defaultOffset = new BMap.Size(10, 100);
			}
			// 控件类 
			function ToEqCenter () {
				// 默认停靠位置和偏移量
			  this.defaultAnchor = BMAP_ANCHOR_TOP_LEFT;
			  this.defaultOffset = new BMap.Size(10, 60);
			}
			function TrafficLayerControl () {
				// 默认停靠位置和偏移量
			  this.defaultAnchor = BMAP_ANCHOR_TOP_LEFT;
			  this.defaultOffset = new BMap.Size(10, 100);
			}
			function setNearContent (title, data) {
				var itemcontent = [];
				var header = '<div class="eqmes-info"><h4 class="info-title">' + title + '</h4><div class="info-content"><table class="table table-bordered table-hover table-condensed">';
				for(var item in data) {
					if(data.hasOwnProperty(item)){
						if(item === 'latitude' || item === 'longitude')
						{
							data[item] = parseFloat(data[item]).toFixed(2);
						}
						var _itemcontent = '<tr class="info-item"><td><label>' + NEAR_EU[item] + '<span><img src="IMAGES/mapimg/nearCity.png"></span></label></td><td><span>' + data[item] + '</span></td></tr>';
						itemcontent.push(_itemcontent);
					}
				}
				var foot = '</div></div>';
				header += itemcontent.join('');
				var content = header + foot;
				return content;
			}
			function setHisContent (title, data) {
				var itemcontent = [];
				var header = '<div class="eqmes-info"><h4 class="info-title">' + title + '</h4><div class="info-content"><table class="table table-bordered table-hover table-condensed">';
				for(var item in data) {
					if(data.hasOwnProperty(item) && item !== 'OBJECTID'){
						if(item === 'Latitude' || item === 'Longitude' )
						{
							data[item] = parseFloat(data[item]).toFixed(2);
						}
						var _itemcontent = '<tr class="info-item"><td><label>' + HIS_EU[item] + '<span><img src="IMAGES/icon/tdhis1.png"></span></label></td><td><span>' + data[item] + '</span></td></tr>';
						itemcontent.push(_itemcontent);
					}
				}
				var foot = '</div></div>';
				header += itemcontent.join('');
				var content = header + foot;
				return content;
			}
			function setEqCenterContent (title, data) {
				var itemcontent = [];
				var header = '<div class="eqmes-info"><h4 class="info-title">' + title + '</h4><div class="info-content"><table class="table table-bordered table-hover table-condensed">';
				for(var item in data) {
					if(data.hasOwnProperty(item) && item !== 'OBJECTID'){
						if(item === 'lat' || item === 'lon' )
						{
							data[item] = parseFloat(data[item]).toFixed(2);
						}
						if (item === 'int') 
						{
							data[item] = getRoma(parseInt(data[item]));
						}
						var _itemcontent = '<tr class="info-item"><td><label>' + EQ_CENTER_EU[item] + '<span><img src="IMAGES/mapimg/centerstar.png"></span></label></td><td><span>' + data[item] + '</span></td></tr>';
						itemcontent.push(_itemcontent);
					}
				}
				var foot = '</table></div></div>';
				header += itemcontent.join('');
				var content = header + foot;
				return content;
			}
			function getEqCenterMes() {
				var eqmes = {};
				eqmes.name = $('#name').val();
				eqmes.province = $('#province').val();
				eqmes.city = $('#city').val();
				eqmes.lat = $('#lat').val();
				eqmes.lon = $('#lon').val();
				eqmes.time = $('#time').val();
				eqmes.magn = $('#magn').val();
				eqmes.int = $('#int').val();
				eqmes.depth = $('#depth').val();
				return eqmes;
			}
			function centerAndZoom(map, centerPoint, zoom) {
				map.centerAndZoom(centerPoint, zoom)
			}
			function getRoma(num) {
				var lap = ['I', 'V', 'X', 'L', 'C', 'D', 'M'];
				var roma = '';
				var bit = 0;
				while(num > 0) {
					var tempnum = num % 10;
					switch(tempnum) {
						case 3:
							roma = lap[bit] + roma;
							tempnum--;
						case 2:
							roma = lap[bit] + roma;
							tempnum--;
						case 1:
						    roma = lap[bit] + roma;
						    break;
						case 4:
							roma = lap[bit + 1] + roma;
							roma = lap[bit] + roma;
							break;
						case 8:
							roma = lap[bit] + roma;
							tempnum--;
						case 7:
							roma = lap[bit] + roma;
							tempnum--;
						case 6:
							roma = lap[bit] + roma;
							tempnum--;
						case 5:
						    roma = lap[bit + 1] + roma;
						    break;
						case 9:
							roma = lap[bit + 2] + roma;
							roma = lap[bit] + roma;
							break;
						default:
							break;
					}
					bit += 2;
					num = Math.floor(num / 10);
				}
				return roma;
			}
			function setTdTemplate(_data) {
				$('.tdMaps .td-near .near-mes').each(function (i, ev) {
					$(ev).find('.header .title').text(_data.nearCityData[i].name || '无数据');
					$(ev).find('.header .meta-distance').text(_data.nearCityData[i].distence || '无数据');
					$(ev).find('.body .area .area-num').text(_data.nearCityData[i].area || '无数据');
					$(ev).find('.body .economy .economy-num').text(parseFloat(_data.nearCityData[i].GDP/100000000).toFixed(2) || '无数据');
					$(ev).find('.body .population .population-num').text(parseFloat(_data.nearCityData[i].POP_ALL/10000).toFixed(2) || '无数据');
				})
				$('.tdMaps .td-history .his-container .his-list .his-list-item').each(function (i, ev) {
					if(i === 0) var _selfdata = _data.hisEqData.hisOne;
					else if(i === 1) var _selfdata = _data.hisEqData.hisSec;
					else if(i === 2) var _selfdata = _data.hisEqData.hisThr;
					$(ev).find('.item-container .container-header .meta-time').text(_selfdata.EarthquakeDate || '无数据');
					$(ev).find('.item-container .container-body .body-header .meta-description').text(_selfdata.Macro_epicenter + parseFloat(_selfdata.Magnitude) + '地震' || '无数据');
					$(ev).find('.item-container .body-container .population .population-num').text(_selfdata.Death || '无数据');
					$(ev).find('.item-container .body-container .area .area-num').text(_selfdata.Area || '无数据');
					$(ev).find('.item-container .body-container .economy .economy-num').text(_selfdata.DirectEconomicLoss || '无数据');
				})
			}
			function setIntensityCricle (map, centerPoint, data) {
				data = parseFloat(data.substr(0,1));
		        var R = new Array();//存放半径
		        var I = new Array();//存放罗马数字
		        var cricles = new Array();//存放圆的数组
		        if(data <= 4.5){
		            alert("数据过小",{icon:5});
		            return;
		        }else if(data>= 4.5 && data < 4.7){
		            R = [10];
		            I = ['Ⅵ'];
		        }else if(data >= 4.7 && data < 5.3){
		            R = [5,15];
		            I = ['Ⅵ','Ⅶ'];
		        }else if(data >= 5.3 && data < 5.7){
		            R = [10,30];
		            I = ['Ⅵ','Ⅶ'];
		        }else if(data >= 5.7 && data < 6.3){
		            R = [10,20,40];
		            I = ['Ⅵ','Ⅶ','Ⅷ'];
		        }else if(data >= 6.3 && data < 6.7){
		           R = [5,20,50,100];
		           I = ['Ⅵ','Ⅶ','Ⅷ','Ⅸ'];
		        }else if(data >= 6.7 && data < 7.2){
		            R = [7.5,30,70,150];
		            I = ['Ⅵ','Ⅶ','Ⅷ','Ⅸ'];
		        }else if(data>= 7.2){
		            alert("数据过大",{icon:5});
		            return;
		        }

		        var colorIntensity=['#9A0103','#D03A00','#FFDD04','#82BF24','#AFFF80','#E6FFC8','FFFFCE','D4FFD3','A1E7EA'];//存放颜色

		        for(var i=R.length-1;i>=0;i--){

			        (function(num){
				        var circle = new BMap.Circle( centerPoint , R[num]*1000);
				        circle.setStrokeColor(colorIntensity[num]);
				        circle.setFillColor(colorIntensity[num]); //创建圆
				        circle.setStrokeWeight(1);
				        circle.setFillOpacity(0.3);
				        circle.class="circle";
				        map.addOverlay(circle);
				        cricles.push(circle);
			        })(i)

		        }
		        for(var k=0 ; k<cricles.length ; k++){
			        (function(num){
				        if(num == cricles.length-1){
				            var lat = (centerPoint.lat + cricles[num].ia[0].lat)/2;
				            var lng = (centerPoint.lng + cricles[num].ia[0].lng)/2;
				        }else{
				            var lat = (cricles[num].ia[0].lat - cricles[num+1].ia[0].lat)/2 + cricles[num+1].ia[0].lat;
				            var lng = (cricles[num].ia[0].lng - cricles[num+1].ia[0].lng)/2 + cricles[num+1].ia[0].lng;
				        }
				        var I_point = new BMap.Point(lng,lat);
				        //标注震级
				        var opts = {
				            position : I_point,    // 指定文本标注所在的地理位置
				            offset   : new BMap.Size( -10, -10)    //设置文本偏移量
				        }
				        //实例化label
				        var I_label = new BMap.Label(I[num], opts);  // 创建文本标注对象
				        //改变label样式
				        I_label.setStyle({
				            color : "#000088",
				            backgroundColor:'transparent',//文本背景色
				            borderColor:'transparent',//文本框边框色
				            fontSize : "10px",
				            height : "10px",
				            lineHeight : "10px",
				            fontFamily:"微软雅黑",
				            fontWeight:'bolder'//加粗
				        });
				        map.addOverlay(I_label);
			        })(k)
		        }
			}

		}
		SuBao.init();
		SuBao.getData();
	})
</script>
</body>
</html>
